
<!DOCTYPE html>
<html lang="zh-CN">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	
	<title>导航页后台管理登录</title>
	
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
	<link rel="stylesheet" type="text/css" href="css/material-design-iconic-font.min.css">
	<link rel="stylesheet" type="text/css" href="css/util.css">
	<link rel="stylesheet" type="text/css" href="css/main.css">
</head>

<body>

	<div class="limiter">
		<div class="container-login100" style="background-image: url('image/bg-01.jpg');">
			<div class="wrap-login100 p-l-55 p-r-55 p-t-65 p-b-54">
				<div class="login100-form validate-form">
					<span class="login100-form-title p-b-49">导航页后台管理登录</span>

					<div class="wrap-input100 validate-input m-b-23" data-validate="请输入用户名">
						<span class="label-input100">用户名</span>
						<input class="input100" type="text" id="login_name" name="username" placeholder="请输入用户名" autocomplete="off">
						<span class="focus-input100" data-symbol="&#xf206;"></span>
					</div>

					<div class="wrap-input100 validate-input" data-validate="请输入密码">
						<span class="label-input100">密码</span>
						<input class="input100" type="password" id="password" name="pass" placeholder="请输入密码">
						<span class="focus-input100" data-symbol="&#xf190;"></span>
					</div>

					<div class="text-right p-t-8 p-b-31">
						<br>
					</div>

					<div class="container-login100-form-btn">
						<div class="wrap-login100-form-btn">
							<div class="login100-form-bgbtn"></div>
							<button type="button" class="login100-form-btn" onclick="login()">登 录</button>
						</div>
					</div>

				
				</div>
			</div>
		</div>
	</div>

	<script src="js/jquery-3.2.1.min.js"></script>
	<script src="js/main.js"></script>
	<script>
		var server_url = 'php/server.php';
		//登录
		function login(){
			var form_data = {};
			form_data.submit_message = "login";
			form_data.loginName = document.getElementById("login_name").value;
			form_data.password = document.getElementById("password").value;
			if(form_data.loginName == '' || form_data.password == ''){
				alert("登录名或密码不能为空！");
				return;
			}
			$.post(server_url,form_data,function(json) {
				json = JSON.parse(json);
			    if (json.result=="1"||json.result=='1'||json.result==1) {
			       alert('登录成功！');
				   sessionStorage.setItem('status','yes');
				   window.location.href='index.html';
			    }
			    else {
			        alert('登录失败！'+json.reason);
			    }
			})
		}
	</script>
</body>

</html>